/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.meanzoft.m3d.model.m3dmodel;

import org.lwjgl.util.vector.Vector3f;
import org.lwjgl.util.vector.Vector4f;

/**
 * 
 * http://en.wikipedia.org/wiki/Vertex_(geometry)
 * 
 * @author Meanz
 */
public final class Vertex {

    private float x;
    private float y;
    private float z;
    private float w;

    public Vertex() {
        this(0f, 0f, 0f, 0f);
    }

    public Vertex(Vector3f vec) {
        this(vec.getX(), vec.getY(), vec.getZ(), 0f);
    }

    public Vertex(Vector4f vec) {
        this(vec.getX(), vec.getY(), vec.getZ(), vec.getW());
    }

    public Vertex(float x, float y, float z, float w) {
        setX(x);
        setY(y);
        setZ(z);
        setW(w);
    }

    /**
     * Getters and setters
     */
    public float getX() {
        return x;
    }

    public void setX(float x) {
        this.x = x;
    }

    public float getY() {
        return y;
    }

    public void setY(float y) {
        this.y = y;
    }

    public float getZ() {
        return z;
    }

    public void setZ(float z) {
        this.z = z;
    }

    public float getW() {
        return w;
    }

    public void setW(float w) {
        this.w = w;
    }
    
    public Vector3f to3fVector() {
        return new Vector3f(x, y, z);
    }
}
